package com.slz3.business.module.systemManagement.sysPermissions.steward;

import com.slz3.business.module.systemManagement.sysPermissions.domain.SysPermissions;
import com.slz3.business.module.systemManagement.sysPermissions.domain.SysPermissionsCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class SysPermissionsResponse {

    public static Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(SysPermissions.class).flatMap(sysPermissions ->
                SysPermissionsResController.add(req, sysPermissions)
        );
    }

    public static Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(SysPermissionsCondition.class).flatMap(sysPermissionsCondition ->
                SysPermissionsResController.delete(req, sysPermissionsCondition)
        );
    }

    public static Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(SysPermissions.class).flatMap(sysPermissions ->
                SysPermissionsResController.modify(req, sysPermissions)
        );
    }


    public static Mono<ServerResponse> list(ServerRequest req) {
        return SysPermissionsResController.list(req);
    }

    public static Mono<ServerResponse> info(ServerRequest req) {
        return SysPermissionsResController.info(req);
    }

    public static Mono<ServerResponse> choice(ServerRequest req) {
        return SysPermissionsResController.choice(req);
    }

    public static Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(SysPermissionsCondition.class).flatMap(sysPermissionsCondition ->
                SysPermissionsResController.auditSubmit(req, sysPermissionsCondition)
        );
    }

    public static Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(SysPermissionsCondition.class).flatMap(sysPermissionsCondition ->
                SysPermissionsResController.audit(req, sysPermissionsCondition)
        );
    }

    public static Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(SysPermissionsCondition.class).flatMap(sysPermissionsCondition ->
                SysPermissionsResController.auditReject(req, sysPermissionsCondition)
        );
    }

    public static Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(SysPermissionsCondition.class).flatMap(sysPermissionsCondition ->
                SysPermissionsResController.usingEnable(req, sysPermissionsCondition)
        );
    }

    public static Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(SysPermissionsCondition.class).flatMap(sysPermissionsCondition ->
                SysPermissionsResController.usingDisable(req, sysPermissionsCondition)
        );
    }   

}
